package com.zslibrary.Enum;

import androidx.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class CommunicationError {
    public static final int E_SUCCESS=0;
    public static final int E_IO=1;
    public static final int E_WRONG_XOR=2;
    public static final int E_WRONG_DATA=3;
    public static final int E_NOT_IMPLEMENT=4;
    public static final int E_DATA_NOT_FOUND=5;
    public static final int E_NOT_SUPPORT=6;
    public static final int E_BUSY=7;
    public static final int E_INTERNAL=8;
    public static final int E_IDLE=9;
    public static final int E_IMPLEMENT=10;

    @IntDef({
            E_SUCCESS,
            E_IO,
            E_WRONG_XOR,
            E_WRONG_DATA,
            E_NOT_IMPLEMENT,
            E_DATA_NOT_FOUND,
            E_NOT_SUPPORT,
            E_BUSY,
            E_INTERNAL,
            E_IDLE,
            E_IMPLEMENT
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface BusError{}

    private int mError;
    public void setBusError(@BusError int e){
        mError=e;
    }

    @BusError
    public int getBusError(){
        return mError;
    }


}
